package io.gitee.yth.design.pattern.test.core.pattern.creational.factory.pizzafactory;

import io.gitee.yth.design.pattern.test.core.pattern.creational.factory.pizza.CheesePizza;
import io.gitee.yth.design.pattern.test.core.pattern.creational.factory.pizza.GreekPizza;
import io.gitee.yth.design.pattern.test.core.pattern.creational.factory.pizza.Pizza;

/**
 * 简单工厂
 *
 * @author yth
 * @since 2023-04-17-0:45
 */
public class PizzaSimpleFactory {

    public Pizza createPizza(String orderType) {
        switch (orderType) {
            case "greek":
                return new GreekPizza();
            case "cheese":
                return new CheesePizza();
            default:
                return null;
        }
    }

}
